Since a memory card such as an SD memory card and compact flash (registered trademark) is small-sized among semiconductor memory cards, it is provided in practical use as a detachable memory device of portable device such as a digital still camera.
A semiconductor memory device provided in practical use usually has at least one flash memory, which is non-volatile memory and a controller LSI of its control circuit built-in inside. Recently, as needs for high enlargement of capacity of the semiconductor memory device are increasing, high enlargement of capacity of non-volatile memory chip in itself is also progressing. In addition, as mounting technique develops, the number of non-volatile memory chips mounted in semiconductor memory device increases and the chips over 1 GB as memory space of semiconductor memory device are put into practical use.
There are two main methods for management of address management information in the flash memory. The first method is a method for storing address management information together, in a whole memory region of a memory card or in every area that is made by dividing the whole memory region into predetermined number, in predetermined block. This address management method is called as a concentrated address management method.
In the second method, when data is written in predetermined page (sector) consisting of physical block, management information, namely status information showing effectiveness of the data and logical addresses are written in a redundancy region of a physical block in which the page is included. And the method is for composing an address management table in a memory by reading management information dispersively written in respective physical blocks at power activation. This address management method is called as a dispersive address management method. The present invention assumes the dispersive address management method.
Next, an example of a main storage memory of a semiconductor memory device in the dispersive address management method will be explained. It is assumed that the main storage memory has a capacity of 4 G bits, that is to say, 512 M bytes. A main storage memory 11 consists of a plurality of physical blocks, for example, 2048 physical blocks including from PB0 to PB2047. It is assumed that data capacity of respective physical blocks is 256 kB (bytes). It is assumed that this main storage memory is a binary NAND flash memory.
FIG. 2 is an explanation view showing one physical block. Respective physical blocks are composed of 128 pages including page 0 to page 128 in this example. Respective pages are composed of management region (MR) and data region of 4 sectors including sector 0 to sector 3. One sector has a capacity of 512 B and respective pages have a data region of 2048 B in total. The management region has a capacity of 64 B. A state code showing validity or invalidity of the data, writing completion flag and ECC code for error collection are included in the management region. The ECC code has a function of 1 or 2 bits error correction in its data region. Since this main storage memory is a binary NAND flash memory, independent writing becomes possible in units of pages, in only sector in the page, or in only a part of the management region in the sector.
FIG. 3 is a time chart showing writing or rewriting of data of 1 cluster (16 kB). In this example, Data is written in page 0 to page 7 in one physical block. Writing time T1 is, for example, a few milliseconds. And, immediately after a completion of writing of page 7, a writing completion flag is written in the management region of the page 7 in FIG. 2. Writing time T2 is, for example, 200 to 300 microseconds. And further, in the case of rewriting, a processing that copies data written in other block to new physical block is performed in addition to the writing in page 0 to page 7. It is assumed that the rewriting time is T3. The writing completion flag is written in page 7, 15, . . . 127 that are last pages of respective valid clusters (T2).
In doing so, time to write the writing completion flag in the main storage memory is required, however, in the case where the power-off happened, it can be determined whether the data writing succeeded or failed on the basis of the fact that the writing completion flag in this management region had been written or not written at the time of the power-on after the power-off. Reliability improves since clusters or blocks including pages that have the writing completion flag can be handled as that which records assured data. (see Patent document 1).    Patent document 1: Unexamined Patent Publication 2003-15929.